home *** CD-ROM | disk | FTP | other *** search
- Path: erich.triumf.ca!bennett
- From: bennett@erich.triumf.ca (P.Bennett)
- Newsgroups: comp.lang.c
- Subject: Re: Character String --> Integer
- Date: 7 Feb 1996 15:08 PST
- Organization: TRIUMF: Tri-University Meson Facility
- Distribution: world
- Message-ID: <7FEB199615084505@erich.triumf.ca>
- References: <4fb0ga$lsa@remus.rutgers.edu>
- NNTP-Posting-Host: ftp.triumf.ca
- News-Software: VAX/VMS VNEWS 1.50
-
- In article <4fb0ga$lsa@remus.rutgers.edu>, wempa@remus.rutgers.edu (Force Of Nature) writes...
- >Is there an easy way to convert a character string such as '2425' to the
- >integer 2425 ??? The only way I can think of is to pick off characters
- >one at a time and use switch statements to determine the value (0-9) and
- >then multiply by the correct power of 10. Is there an easier way to do
- >this ???????
-
- Try the following functions:
- sscanf()
- atoi()
- (to convert an int to a string, use sprintf() )
-
- Peter Bennett VE7CEI | Vessels shall be deemed to be in sight
- Internet: bennett@triumf.ca | of one another only when one can be
- Packet: ve7cei@ve7kit.#vanc.bc.ca | observed visually from the other
- TRIUMF, Vancouver, B.C., Canada | ColRegs 3(k)
- GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
-
-